package com.ktwlsoft.fundmanage.domain.entity.sms;

import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.*;
import javax.validation.constraints.Pattern;
import java.util.Date;

/**
 * 短信日志
 *
 * @author Name on 2019/5/5 10:20
 * @version 1.0
 */
@Entity
@Table(name = "sms_log")
@Getter
@Setter
public class SmsLog {

    /**主键*/
    @Id
    @Column(name = "id",columnDefinition = "bigint(30) NOT NULL COMMENT '主键'")
    private Long id;

    /**用户账号*/
    @ApiModelProperty(value = "用户账号")
    @Column(name = "account_id",columnDefinition = "varchar(50) DEFAULT NULL COMMENT '用户账号'")
    private String accountId;

    /**手机号*/
    @ApiModelProperty(value = "手机号")
    @Pattern(regexp = "^((1[3,5,8][0-9])|(14[5,7])|(17[0,6,7,8])|(19[7]))\\d{8}$", message = "手机号码不正确")
    @Column(name = "mobile",columnDefinition = "varchar(20) NOT NULL COMMENT '手机号'")
    private String mobile;

    /**json文本内容*/
    @ApiModelProperty(value = "json文本内容")
    @Column(name = "content",columnDefinition = "varchar(500) DEFAULT NULL COMMENT 'json文本内容'")
    private String content;

    /**显示文本内容*/
    @ApiModelProperty(value = "显示文本内容")
    @Column(name = "display_content",columnDefinition = "varchar(255) DEFAULT NULL COMMENT '显示文本内容'")
    private String displayContent;

    /**创建时间*/
    @ApiModelProperty(value = "创建时间")
    @Column(name = "create_time",columnDefinition = "datetime DEFAULT NULL COMMENT '创建时间'")
    private Date createTime;

    /**备注*/
    @ApiModelProperty(value = "备注")
    @Column(name = "remark",columnDefinition = "varchar(255) DEFAULT NULL COMMENT '备注'")
    private String remark;

    /**发送状态:0失败 1成功*/
    @ApiModelProperty(value = "发送状态:0失败 1成功")
    @Column(name = "status",columnDefinition = "tinyint(4) DEFAULT 0 COMMENT '发送状态:0失败 1成功'")
    private Integer status;
}